package com.lyy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Liangyaoyun
 */
@RestController
@RequestMapping("/api/v1")
public class exceptionTest {
    @RequestMapping("/exe/{nums}")
    public String test(@PathVariable("nums") Integer nums){
        if (nums==0){
            throw new RuntimeException("除数不能为0");
        }
        return "测试成功";
    }
}
